﻿using System;
using Behaviorize.CodeGenerator.TextInterpretation;
using EnvDTE;

namespace Behaviorize.CodeGenerator
{
	public static class ExtensionMethods
	{
		public static string AsPascal(this string text)
		{
			return PascalFormatter.ToPascalCase(text);
		}

		public static vsCMTypeRef AsVsCMTypeRef(this Type type)
		{
			if (type == typeof(string)) return vsCMTypeRef.vsCMTypeRefString;
			if (type == typeof(Int32)) return vsCMTypeRef.vsCMTypeRefInt;
			if (type == typeof(bool)) return vsCMTypeRef.vsCMTypeRefBool;
			if (type == typeof(double)) return vsCMTypeRef.vsCMTypeRefDouble;

			return vsCMTypeRef.vsCMTypeRefString;
		}
	}
}